// 视图组件
const view = {
  tabs: () => import('@/layouts/tabs'),
  blank: () => import('@/layouts/BlankView'),
  page: () => import('@/layouts/PageView')
}

// 路由组件注册
const routerMap = {
  // login: {
  //   authority: '*',
  //   path: '/login',
  //   component: () => import('@/pages/login')
  // },
  root: {
    path: '/',
    name: '首页',
    redirect: '/login',
    component: view.tabs
  },
  dashboard: {
    name: 'Dashboard',
    component: () =>
      import('@/views/dashboard/index'),
  },
  profile: {
    path: '/profile',
    name: '商户中心',
    meta: {
      icon: 'shop'
    },
    component: () =>
      import('@/views/profile/index.vue')
  },

  orders: {
    path: 'orders',
    name: '订单管理',
    meta: {
      icon: 'shopping'
    },
    component: view.page,
  },
  buy: {
    path: 'buy',
    name: '买入订单',
    component: () =>
      import('@/views/buy')
  },
  sell: {
    path: 'sell',
    name: '卖出订单',
    component: () =>
      import('@/views/sell')
  },

  balance: {
    path: 'balance',
    name: '财务管理',
    meta: {
      icon: 'account-book'
    },
    component: view.page,
  },
  details: {
    path: 'details',
    name: '账变明细',
    component: () =>
      import('@/views/balance/index'),
    meta: {
      exportBtn: true
    }
  },
  report: {
    path: 'report',
    name: '数据报表',
    component: () =>
      import('@/views/balance/report'),
    meta: {
      exportBtn: true
    }
  },

  manual: {
    path: 'manual',
    name: '人工出币',
    meta: {
      icon: 'transaction'
    },
    component: view.page,
  },
  out: {
    path: 'out',
    name: '手动出币',
    component: () =>
      import('@/views/manual/out')
  },
  sdk: {
    path: 'sdk',
    name: 'SDK接口出单',
    component: () =>
      import('@/views/manual/sdk')
  },

  coins: {
    path: 'coins',
    name: '买币',
    meta: {
      icon: 'money-collect'
    },
    component: () =>
      import('@/views/coins')
  },

  config: {
    path: 'config',
    name: '设置',
    meta: {
      icon: 'control'
    },
    component: view.page,
  },

  password: {
    path: 'password',
    name: '登录密码',
    component: () =>
      import('@/views/password/reset')
  },
  security: {
    path: 'security',
    name: '安全密码',
    component: () =>
      import('@/views/password/security')
  },

  sub: {
    path: 'sub-account',
    name: '子账户',
    component: () =>
      import('@/views/sub-account'),
    meta: {
      addBtn: true
    }
  },

  ga: {
    path: 'google-verify',
    name: '谷歌验证',
    component: () =>
      import('@/views/ga'),
  },

  whitelist: {
    path: 'whitelist',
    name: '登录白名单',
    component: () =>
      import('@/views/whitelist'),
  },


  exception: {
    name: '异常页',
    icon: 'warning',
    component: view.blank
  },
  exp403: {
    authority: '*',
    name: 'exp403',
    path: '403',
    component: () => import('@/pages/exception/403')
  },
  exp404: {
    name: 'exp404',
    path: '404',
    component: () => import('@/pages/exception/404')
  },
  exp500: {
    name: 'exp500',
    path: '500',
    component: () => import('@/pages/exception/500')
  },
}
export default routerMap

